<?php
if (!defined('APP_ID')) { die('No direct script access allowed'); }

// Error reporting level
error_reporting(E_ALL);

// Set up default time zone
date_default_timezone_set('UTC');

// Set locale
setlocale(LC_ALL, 'en_US.utf-8');

// Including core system class
require_once(SYS_DIR . 'classes' . DIR_SEP . 'node' . PHP_EXT);

// Registering auto load method
spl_autoload_register(array('Node', 'autoLoad'));

// Setup
Node::init(array(
	'modules' => array(
		'cms',
		'cache',
		'database',
		'upload',
		'image',
		'auth',
		'email'
	)
));

// Default route
Router::addRoute('default', '/backend(/<language>)(/<controller>)(/<action>)')
	->rules(array(
		'language' => '(en|ru|he)'
	))
	->defaults(array(
		'language' => 'en',
		'controller' => 'home',
		'action' => 'index'
	));

// Execute system
Node::execute();
